import requests


def main():
    url = "https://qianfan.baidubce.com/v2/app/conversation/file/upload"

    payload = {
        'app_id": "3d661451-a066-4186-bcb4-d1b57f2bc858',
        'conversation_id": "23d683e7-6500-466f-b0ea-1254e4a05657'
    }
    files = [
        ('file', ('R-C.jpg', open('C:\\Users\\zh415st022\\Desktop\\641.jpg', 'rb'), 'image/jpeg'))
    ]
    headers = {
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-JF19wDK4Fjm8QVJkSng9F/e8e69f73fa351aeca4c3926e0bca1e15b565b53f'
    }

    response = requests.request("POST", url, headers=headers, data=payload, files=files)

    print(response.text)


if __name__ == '__main__':
    main()
